home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:include href="..\..\..\Libraries\datetime_lib.xsl"/>
- <xsl:output method="html" encoding="ISO-8859-1" indent="yes"/>
-
- <xsl:key name="kDistinctDates" match="result" use="@date"/>
- <xsl:key name="kDistinctGameScorers" match="scorer" use="concat(generate-id(parent::*),@name)"/>
- <xsl:template match="/">
- <html>
- <head>
- <title>
- <xsl:value-of select="/results/@nation"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="/results/@sponsor"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="/results/@league"/>
- <xsl:text> (results)</xsl:text>
- </title>
- </head>
- <body>
- <h3>
- <xsl:value-of select="/results/@nation"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="/results/@sponsor"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="/results/@league"/>
- <xsl:text> (results)</xsl:text>
- </h3>
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="150"></td>
- <td width="40"></td>
- <td width="150"></td>
- <td width="50"></td>
- </tr>
- <xsl:apply-templates select="results/result[generate-id() = generate-id(key('kDistinctDates',@date))]" mode="distinct-date">
- <xsl:sort select="translate(@date,'-','')" data-type="number"/>
- </xsl:apply-templates>
- </table>
- </body>
- </html>
- </xsl:template>
-
- <xsl:template match="result" mode="distinct-date">
- <tr>
- <td colspan="4" align="center" style="color: Navy; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 9pt;">
- <hr noshade="yes"/>
- <xsl:call-template name="format-date-time">
- <xsl:with-param name="datetime" select="@date"/>
- <xsl:with-param name="format-string" select="'dowwww, dth mmmm yyyy'"/>
- </xsl:call-template>
- </td>
- </tr>
- <xsl:apply-templates select="key('kDistinctDates',@date)" mode="show-result">
- <xsl:sort select="home/@team"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="result" mode="show-result">
- <tr>
- <td colspan="4" height="5"></td>
- </tr>
- <tr style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt;">
- <td align="left" style="color: Navy; font-weight: bold;">
- <xsl:value-of select="home/@team"/>
- </td>
- <td align="center">
- <xsl:text>(</xsl:text>
- <xsl:value-of select="count(home/scorer[@min <= 45])"/>
- <xsl:text>-</xsl:text>
- <xsl:value-of select="count(away/scorer[@min <= 45])"/>
- <xsl:text>) </xsl:text>
- <xsl:value-of select="home/@score"/>
- <xsl:text>-</xsl:text>
- <xsl:value-of select="away/@score"/>
- </td>
- <td align="right" style="color: Navy; font-weight: bold;">
- <xsl:value-of select="away/@team"/>
- </td>
- <td align="right">
- <xsl:value-of select="format-number(@attendance,'#,##0')"/>
- </td>
- </tr>
- <xsl:if test="home/@score != 0 or away/@score != 0">
- <tr style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt;">
- <td align="left" valign="top">
- <xsl:apply-templates select="home" mode="show-scorers"/>
- </td>
- <td></td>
- <td align="right" valign="top">
- <xsl:apply-templates select="away" mode="show-scorers"/>
- </td>
- <td></td>
- </tr>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="home|away" mode="show-scorers">
- <xsl:for-each select="scorer[generate-id() = generate-id(key('kDistinctGameScorers',concat(generate-id(parent::*),@name)))]">
- <xsl:sort select="min" data-type="number"/>
- <xsl:value-of select="@name"/>
- <xsl:for-each select="key('kDistinctGameScorers',concat(generate-id(parent::*),@name))">
- <xsl:text> </xsl:text>
- <xsl:value-of select="@min"/>
- <xsl:choose>
- <xsl:when test="@type = 'pen'">
- <xsl:text>(pen)</xsl:text>
- </xsl:when>
- <xsl:when test="@type = 'og'">
- <xsl:text>(og)</xsl:text>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="position() != last()">
- <xsl:text>,</xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="position() != last()">
- <br/>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- </xsl:stylesheet>